<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SystemMessage extends Model
{
    protected $table = "c_system_messages";

    /**
     * @return array
     * 系统消息
     */
    public function getList($param)
    {
        $res = $this::where([['type','=',$param['type']]])->orderBy("id", "desc")->get();
        if (!empty($res)) {
            return $res->toArray();
        }
        return [];
    }

    /***
     * @return array
     * 系统消息详情
     */
    public function getListDetail($param)
    {
        $res = $this::where([['id', '=', $param['id']]])->orderBy("id", "desc")->first();
        if (!empty($res)) {
            return $res->toArray();
        }
        return [];
    }



}
